finp$="picture.png"
if argc>=3 then:finp$=command$(3):end if
xed=80:yed=75
setdisplay(xed,yed,32,1):paper(8^8-1):ink(0):pen(0):cls:
loadimage(finp$,1):pasteicon(0,0,1)
open finp$+".bin" for output as #1
for y1=0 to yed-1 step 3
  writebyte(1,0x97)
  for x1=2 to xed-1 step 2
    chou=0:mb=1
    for y2=0 to 2
      for x2=0 to 1
        q=(y2*2)+x2
        y=y1+y2
        x=x1+x2
        i=point(x,y)
        b=i mod 256:i=int(i/256)
        g=i mod 256:i=int(i/256)
        r=i mod 256
        k=0:if g>127 then
          k=1:end if
        chou=chou+(k*mb)
        mb=mb*2
        next:next
    if bitwiseand(chou,0x20)<>0 then
      chou=bitwisexor(chou,0x60):end if
    chou+=0x20
    writebyte(1,chou)
    next:next
close #1


